--铸铁燃魂
local zhutieranhun = fk.CreateSkill {
    name = "mcdh_zhutieranhun",
}

local U = require "packages/utility/utility"
local lib = require "packages/mcdh/lib"

zhutieranhun:addEffect('active',{
    prompt = "#mcdh_zhutieranhun_prompt",
    can_use = function (self, player, card, extra_data)
        return player:usedSkillTimes(self.name, Player.HistoryPhase) == 0
    end,
    target_num = 2,
    card_filter = Util.FalseFunc,
    target_filter = function(self,player, to_select, selected, cards)
        if #selected == 2 then
            return false
        end
        local target = to_select
        if target then
            if #selected > 0 then
                return selected[1]:canMoveCardsInBoardTo(target,"e")
            end
            local fromAreas = { Player.Equip }
            return #target:getCardIds(fromAreas) > 0
        end
    end,
    on_use = function (self, room, use)
        local player = use.from
        local from = use.tos[1]
        local to = use.tos[2]
        local target = room:askToMoveCardInBoard(player,{target_one=from,target_two =to,skill_name=self.name,flag="e"}).from
        if target:isAlive() then
            target:drawCards(2,self.name)
            room:setPlayerMark(target,"@@mcdh_zhutieranhun_mark-turn",1)
        end
    end,
})

zhutieranhun:addEffect(fk.CardUsing,{
    can_refresh = function (self, event, target, player, data)
        return  player:getMark("@@mcdh_zhutieranhun_mark-turn") == 1 
    end,
    on_refresh = function (self, event, target, player, data)
        local room = player.room
        data.disresponsiveList = data.disresponsiveList or {}
        table.insertIfNeed(data.disresponsiveList,player)
    end
})

Fk:loadTranslationTable {
    ["mcdh_zhutieranhun"] = "铁魂",
    [":mcdh_zhutieranhun"] = "『铸铁燃魂』<br>出牌阶段限一次，你可以移动场上一张装备牌，然后因此失去牌的角色摸两张牌，其本回合不能响应牌",
    ["@@mcdh_zhutieranhun_mark-turn"] = "铸铁燃魂",
    ["#mcdh_zhutieranhun_prompt"] = "铸铁燃魂：移动场上一张牌，被移动牌的角色摸两张牌，其本回合不能响应牌"
}

return zhutieranhun